<template>
	<view class="container">
		<!-- 全屏背景图片 -->
		<image class="fullscreen-bg" src="http://st24cnfz3.hn-bkt.clouddn.com/mainbackground.png" mode="aspectFill" />
		<view class="main">
			<!-- 顶部导航栏（根据需求选用） -->
			<!-- <custom-navbar /> -->

			<view class="model0-grid">
				<view class="model0-grid-item">
					<view class="model0-grid-inner" bindtap="model1_click1">
						<view class="model0-grid-icon model0-avatar radius">
							<image mode="aspectFit" class="model0-avatar-img radius"
								src="/static/icon/1jingdianjieshao.png"></image>
						</view>
						<view class="model0-grid-title"> 景点介绍 </view>
						<view class="model0-grid-red-dot"></view>
					</view>
				</view>
				<view class="model0-grid-item">
					<view class="model0-grid-inner" bindtap="model2_click2">
						<view class="model0-grid-icon model0-avatar radius">
							<image mode="aspectFit" class="model0-avatar-img radius"
								src="/static/icon/2jingdiangushi.png"></image>
						</view>
						<view class="model0-grid-title"> 景点介绍 </view>
						<view class="model0-grid-white-dot"></view>
					</view>
				</view>
				<view class="model0-grid-item">
					<view class="model0-grid-inner" bindtap="model3_click3">
						<view class="model0-grid-icon model0-avatar radius">
							<image mode="aspectFit" class="model0-avatar-img radius"
								src="/static/icon/3jingdiantiyan.png"></image>
						</view>
						<view class="model0-grid-title"> 景点介绍 </view>
						<view class="model0-grid-white-dot"></view>
					</view>
				</view>
			</view>

			<!-- 轮播图区域 -->
			<view class="swiper_margin">
				<swiper class="swiper" indicator-dots autoplay circular>
					<swiper-item v-for="(item, index) in swiperList" :key="index">
						<image :src="item.image" class="swiper-img" mode="aspectFill" />
					</swiper-item>
				</swiper>
			</view>

			<!-- 景点列表 -->
			<view class="attraction-list">
				<view v-for="(item, index) in attractionList" :key="index" class="attraction-item">
					<!-- 新增图片容器 -->
					<image class="item-image" :src="item.imageUrl" mode="aspectFill" />

					<!-- 右侧内容容器 -->
					<view class="content-wrapper">
						<view class="title-row">
							<text class="title">{{ item.name }}</text>
							<text class="tags">{{ item.tags }}</text>
						</view>

						<view class="type-row">
							<text class="type">{{ item.type }}</text>
							<text class="divider">|</text>
							<text class="reserve">{{ item.reserve }}</text>
						</view>

						<view class="keywords">
							<text v-for="(kw, i) in item.keywords" :key="i" class="keyword-tag">
								{{ kw }}
							</text>
						</view>

						<view class="info-row">
							<text>门票：{{ item.ticket }}</text>
							<text>开放时间：{{ item.openTime }}</text>
						</view>
					</view>
				</view>
			</view>

		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				swiperList: [{
						image: 'http://st24cnfz3.hn-bkt.clouddn.com/background111.jpg'
					},
					{
						image: 'http://st24cnfz3.hn-bkt.clouddn.com/background111.jpg'
					},
					{
						image: 'http://st24cnfz3.hn-bkt.clouddn.com/background111.jpg'
					}
				],
				attractionList: [{
						imageUrl: 'http://st24cnfz3.hn-bkt.clouddn.com/background111.jpg', // 新增图片字段
						name: '沙洲村：红色记忆的传承地',
						type: '革命旧址',
						reserve: '免费预约',
						keywords: ['历史文物', '革命记忆'],
						ticket: '免费',
						openTime: '全年开放'
					},
					{
						imageUrl: 'http://st24cnfz3.hn-bkt.clouddn.com/background111.jpg', // 新增图片字段
						name: '郴州汝城云顶书院',
						type: '名胜古迹 文化遗产',
						reserve: '免费预约',
						keywords: ['环境幽静', '景观优美', '拍照圣地'],
						ticket: '免费',
						openTime: '全年8:00-17:00'
					},
					{
						imageUrl: 'http://st24cnfz3.hn-bkt.clouddn.com/background111.jpg', // 新增图片字段
						name: '郴州汝城云顶书院',
						type: '名胜古迹 文化遗产',
						reserve: '免费预约',
						keywords: ['环境幽静', '景观优美', '拍照圣地'],
						ticket: '免费',
						openTime: '全年8:00-17:00'
					},
					{
						imageUrl: 'http://st24cnfz3.hn-bkt.clouddn.com/background111.jpg', // 新增图片字段
						name: '郴州汝城云顶书院',
						type: '名胜古迹 文化遗产',
						reserve: '免费预约',
						keywords: ['环境幽静', '景观优美', '拍照圣地'],
						ticket: '免费',
						openTime: '全年8:00-17:00'
					},
					// 其他景点数据...
				],
			}
		}
	}
</script>

<style lang="scss" scoped>
	//底层壳
	.container {
		position: relative;
		// min-height: 100vh;
		margin: 180rpx 20rpx 20rpx 20rpx;
	}

	.fullscreen-bg {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		z-index: -1;
	}

	.background {
		width: 100%;
		height: 100%;
		background-image:
			url(http://st24cnfz3.hn-bkt.clouddn.com/mainbackground.png);
		;
	}

	//主界面壳
	.main {
		// todo 这里就要计算vh和页面rpx之间的高度比例 
		min-height: 80vh;
		background-color: #ffffff;
		padding: 30rpx 30rpx 30rpx 30rpx;
		border-radius: 100rpx;
	}

	//导航栏
	.custom-navbar {
		display: flex;
		justify-content: space-between;
		/* 横向排列并保持间距 */
		flex-wrap: wrap;
		flex: 1;
		width: 100%;
		/* 确保父容器占据整个宽度 */
		margin: 0 0 0 0;
	}

	.model0-grid {
		display: flex;
		justify-content: space-between;
		/* 横向排列并保持间距 */
		flex-wrap: wrap;
		flex: 1;
		width: 100%;
		/* 确保父容器占据整个宽度 */
		margin: 0 0 0 0;
		height: 100px;
		background-color: #ffffff;
		border-radius: 70rpx;
		/* 确保父容器占据整个宽度 */
		padding: 10rpx 10rpx 10rpx 10rpx;
	}

	.model0-grid-item {
		width: 24%;
		/* 每个组件占据25%的宽度 */
		box-sizing: border-box;
	}

	.model0-grid-inner {
		display: flex;
		align-items: center;
		justify-content: space-around;
		flex-direction: column;
		text-align: center;
		position: relative;
		background-position: center;
		background-repeat: no-repeat;
	}

	.model0-grid-icon {
		width: 60px;
		height: 60px;
	}

	.model0-avatar-img {
		width: 100%;
		height: 100%;
	}

	.model0-grid-title {
		/* todo 更改字体 */
		font-size: 13px
	}

	.model0-grid-red-dot {
		width: 10px;
		height: 10px;
		background-color: #a45b5e;
		border-radius: 50%;
		margin-top: 10rpx;
		right: 20px;
		z-index: 1;
	}

	.model0-grid-white-dot {
		width: 8px;
		height: 8px;
		background-color: white;
		border: 2px solid #a45b5e;
		border-radius: 50%;
		margin-top: 10rpx;
		right: 20px;
		z-index: 1;
	}

	//轮播图区域
	.swiper_margin {
		border-radius: 70rpx;
		overflow: hidden;
	}

	.swiper {
		height: 350rpx;
		border-radius: 60rpx;

		&-img {
			width: 100%;
			height: 100%;
		}
	}

	//景点介绍区域
	.attraction-list {
		// 	padding: 20rpx;
		margin-top: 20rpx;
	}

	.attraction-item {
		display: flex; // 启用flex布局
		padding: 20rpx;
		margin-bottom: 20rpx;
		background: #fff;
		border-radius: 12rpx;
		box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.1);

		.item-image {
			width: 220rpx;
			height: 220rpx;
			border-radius: 10rpx;
			margin-right: 20rpx;
			flex-shrink: 0;
		}

		.content-wrapper {
			flex: 1;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
		}
	}


	.title-row {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 15rpx;

		.title {
			font-size: 32rpx;
			font-weight: bold;
		}

		.tags {
			color: #666;
			font-size: 24rpx;
		}
	}

	.type-row {
		display: flex;
		align-items: center;
		color: #888;
		font-size: 24rpx;
		margin-bottom: 15rpx;

		.divider {
			margin: 0 10rpx;
		}
	}

	.keywords {
		display: flex;
		flex-wrap: wrap;
		margin-bottom: 15rpx;

		.keyword-tag {
			background: #f0f0f0;
			border-radius: 6rpx;
			padding: 6rpx 12rpx;
			margin: 0 10rpx 10rpx 0;
			font-size: 24rpx;
			color: #666;
		}
	}

	.info-row {
		display: flex;
		justify-content: space-between;
		color: #888;
		font-size: 24rpx;
	}
</style>


<style>

</style>